import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/home/index.vue'),
    meta: {
      isFootShow: true,
      keepAlive:true,
    }
  },
  {
    path: '/home/city',
    name: 'city',
    component: () => import('../views/home/city/index.vue'),
    meta: {
      keepAlive:true,
      isFootShow: false,
    }
  },
  {
    path: '/topic',
    name: 'topic',
    component: () => import('../views/topic/index.vue'),
    meta: {
      // keepAlive:true,
      isFootShow: true,
    }
  },
  {
    path: '/category',
    name: 'category',
    component: () => import('../views/category/index.vue'),
    meta: {
      // keepAlive:false,
      isFootShow: true,
    }
  },
  {
    path: '/category/categorylist',
    name: 'categorylist',
    component: () => import('../views/category/categorylist/index.vue'),
    meta: {
      // keepAlive:false,
      isFootShow: false,
    }
  },
  {
    path: '/pages/goods',
    name: 'goods',
    component: () => import('../views/pages/goods/index.vue'),
    meta: {
      // keepAlive:false,
      isFootShow: false,
    }
  },
  {
    path: '/pages/branddetail',
    name: 'branddetail',
    component: () => import('../views/pages/branddetail/index.vue'),
    meta: {
      // keepAlive:false,
      isFootShow: false,
    }
  },
  {
    path: '/pages/brandlist',
    name: 'brandlist',
    component: () => import('../views/pages/brandlist/index.vue'),
    meta: {
      // keepAlive:true,
      isFootShow: false,
    }
  },
  {
    path: '/pages/newgoods',
    name: 'newgoods',
    component: () => import('../views/pages/newgoods/index.vue'),
    meta: {
      // keepAlive:false,
      isFootShow: false,
    }
  },
  {
    path: '/pages/topicdetail',
    name: 'topicdetail',
    component: () => import('../views/pages/topicdetail/index.vue'),
    meta: {
      // keepAlive:true,
      isFootShow: false,
    }
  },
  {
    path: '/pages/collectlist',
    name: 'collectlist',
    component: () => import('../views/pages/collectlist/index.vue'),
    meta: {
      // keepAlive:true,
      isFootShow: false,
    }
  },
  {
    path: '/pages/addressSelect',
    name: 'addressSelect',
    component: () => import('../views/pages/addressSelect/index.vue'),
    meta: {
      // keepAlive:true,
      isFootShow: false,
    }
  },
  {
    path: '/pages/feedback',
    name: 'feedback',
    component: () => import('../views/pages/feedback/index.vue'),
    meta: {
      // keepAlive:true,
      isFootShow: false,
    }
  },
  {
    path: '/pages/search',
    name: 'search',
    component: () => import('../views/pages/search/index.vue'),
    meta: {
      // keepAlive:true,
      isFootShow: false,
    }
  },
  {
    path: '/pages/order',
    name: 'order',
    component: () => import('../views/pages/order/index.vue'),
    meta: {
      // keepAlive:true,
      isFootShow: false,
    }
  },
  {
    path: '/pages/addaddress',
    name: 'addaddress',
    component: () => import('../views/pages/addaddress/index.vue'),
    meta: {
      // keepAlive:true,
      isFootShow: false,
    }
  },
  {
    path: '/cart',
    name: 'cart',
    component: () => import('../views/cart/index.vue'),
    meta: {
      // keepAlive:true,
      isFootShow: true,
    }
  },
  {
    path: '/my',
    name: 'my',
    component: () => import('../views/my/index.vue'),
    meta: {
      // keepAlive:true,
      isFootShow: true,
    }
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
